package com.neusoft.tyut.tyutcat.http;

import lombok.ToString;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

@ToString

public class HttpServletRequest implements ServletRequest{
    private  String  method;
    private  String webName;
    private  String url;
    private Map<String , String> headers = new HashMap<>();

    @Override
    public String getParameter(String name) {
        return null;
    }

    @Override
    public String getMethod() {
        return method;
    }

    @Override
    public String getUrl() {
        return url;
    }

    @Override
    public String getCharacterEncoding() {
        return null;
    }

    @Override
    public String getHeader(String name) {
        return this.headers.get(name);
    }

    @Override
    public Set<String> getHeaderNames() {
        return   this.headers.keySet() ;
    }

    @Override
    public String getHeaders(String name) {
        return null;
    }

    @Override
    public Collection<String> getHeaderValues() {
        return  this.headers.values() ;
    }

    public void setMethod(String  method ) {
        this.method = method;
    }

    public void setWebName(String webName) {
        this.webName = webName;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public void addHeader(String name , String value)
    {
        headers.put(name , value);
    }

}
